# Comment/uncomment the following line to disable/enable debugging
DEBUG = y
# Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
  DEBFLAGS = -O -g -Wall # "-O" is needed to expand inlines
else
  DEBFLAGS = -O2
endif

LOCAL_INC = "./include"
EXTRA_CFLAGS += $(DEBFLAGS) -I$(LOCAL_INC)

ifneq ($(KERNELRELEASE),)
# call from kernel build system
MODULE_NAME=leds
$(MODULE_NAME)-objs:= leds-ry.o leds_class_ry.o
obj-m:= $(MODULE_NAME).o
else
KERNELDIR ?= /data01/project/zlg/linux-2.6.35.3
PWD:= $(shell pwd)
# -C change the root dir
default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif

clean:
	rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers
